package com.leco.demo.spring.processor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;

import java.util.Arrays;

/**
 * @author greg
 * @version 2022/10/23
 * 自定义BeanFactoryPostProcess
 **/
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        System.out.println("=====");
        System.out.println("自定义的BeanFactoryPostProcessor执行了");
        System.out.println(Arrays.toString(beanFactory.getBeanDefinitionNames()));
        System.out.println("=====");
    }
}
